<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="box">
    <ul>
        <li>aaa</li>
        <li>bbb</li>
    </ul>
</div>
<div >
    <ul name="my">
        <li>111</li>
        <li>222</li>
    </ul>
</div>
<script>
    var a = document.getElementById('box');
    var b = document.getElementsByTagName('div');
    console.log(a);//"[object HTMLDivElement] 元素对象
    console.log(b);//"[object HTMLCollection]"

    console.log(b[0] === a);// true
    var c = document.getElementsByTagName('li');

    console.log(c);
    //在第一个#box 的div下找 li标签
//    var d = a.getElementsByTagName('li');
    var d =b[0] .getElementsByTagName('li');//与上一行功能相同
    console.log(d);


    //根据name找元素
    var e = document.getElementsByName('my');//HtmlConllection 集后对象

    console.log(e)
    var f = e[0].getElementsByTagName('li');
    console.log(f);
</script>
</body>
</html>